package com.twu.biblioteca;

import java.io.PrintStream;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: thoughtworker
 * Date: 10/9/13
 * Time: 10:46 AM
 * To change this template use File | Settings | File Templates.
 */
public class Library {
    private List<Book> books;
    private PrintStream printer;

    public List<Book> getBooks() {
        return books;
    }

    Library(List<Book> bookList, PrintStream printer) {
        books = bookList;
        this.printer = printer;

    }

    public void printListOfBooks() {
        for (Book book : books) {
            printer.println(book.getTitle()+" "+book.getBookId()) ;
        }
    }


    public void reserveBook(String bookNumber) {
        //print the stuff
        //get the input
        //rest :
        if(bookNumber.equals("1")){
            printer.println("Thank you! Enjoy the book!");
        }
        else {
            printer.println("Sorry we don't have that book yet.");
        }
    }

    public void printBookListInstructions() {
        printer.println("Enter book number for reservation.");
    }
}
